package org.uk.splitsbrowser.shared;

import java.util.List;

import javax.persistence.Embedded;
import javax.persistence.Id;
import javax.persistence.Version;

import com.google.gwt.user.client.rpc.IsSerializable;
import com.orientechnologies.orient.core.annotation.OId;
import com.orientechnologies.orient.core.annotation.OVersion;

public class User implements IsSerializable {
	
	@Id String id;
	
	@Version long version;  
	
	private String email;
	private boolean club;
	private String firstname;
	private String surname;
	private String password;
	private int role;

	@Embedded
	private String[] ecard;
	private String dateOfBirth;
	
	private List<OEvent> events = null;
	
	@Embedded
	private List<UserResult> results = null;

	
	public User() {
		
	}
	
	public void addEvent(OEvent event) {
		events.add(event);
	}
	
	public void removeEvent(OEvent event) {
		events.remove(event);
	}
		
	// Empty Getters/Setters
	
	public String getId() {
		return id;
	}

	public long getVersion() {
		return version;
	}
	
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public boolean isClub() {
		return club;
	}
	public void setClub(boolean club) {
		this.club = club;
	}
	public String getFirstname() {
		return firstname;
	}
	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}
	public String getSurname() {
		return surname;
	}
	public void setSurname(String surname) {
		this.surname = surname;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String[] getEcard() {
		return ecard;
	}
	public void setEcard(String[] ecard) {
		this.ecard = ecard;
	}
	public String getDateOfBirth() {
		return dateOfBirth;
	}
	public void setDateOfBirth(String dateOfBirth) {
		this.dateOfBirth = dateOfBirth;
	}

	public List<OEvent> getEvents() {
		return events;
	}

	public void setEvents(List<OEvent> events) {
		this.events = events;
	}

	
	public int getRole() {
		return role;
	}

	public void setRole(int role) {
		this.role = role;
	}

}
